package com.wesley.method;

public class Demo06 {
    public static void main(String[] args) {
        System.out.println(f(5));
    }

    //5!  5*f(4)*f(3)*f(2)*f(1)
    //5! f(5) = 1*2*3*4*5
    public static int f(int n){
        if (n == 1){
            return 1;
        }else {
            return n*f(n-1);
        }
    }
}
